#!/usr/bin/env bash

set -ve

export LFS='/mnt/lfs'

_USER=`whoami`
if [ "$_USER" != "lfs" ];
then
    echo 'WARNING: User lfs ONLY!!!' && exit;
fi

############################## Gettext ##############################

cd $LFS/sources/
tar -xvf gettext-0.19.8.1.tar.xz
cd gettext-0.19.8.1/

cd gettext-tools
EMACS="no" ./configure --prefix=/tools --disable-shared

# 编译软件包
make -C gnulib-lib
make -C intl pluralx.c
make -C src msgfmt
make -C src msgmerge
make -C src xgettext

# 安装 msgfmt、msgmerge 和 xgettext 程序
cp -v src/{msgfmt,msgmerge,xgettext} /tools/bin
